<template>
  <div>
    <hzhy-data-table ref="dataTable" v-bind="tableConfigTask"></hzhy-data-table>
  </div>
</template>

<script>
import * as api from '@/const/api'

export default {
  title: '历史注册申请',
  name: 'CustomerHistory',
  data() {
    return {}
  },
  computed: {
    tableConfigTask() {
      return {
        url: api.userPage,
        customQuery: {
          userType: 2,
        },
        columns: [
          {
            label: '序号',
            type: 'index',
            prop: 'index',
          },
          {
            label: '姓名',
            prop: 'name',
          },
          {
            label: '性别',
            prop: 'sex',
            formatter: ({ sex }) => (sex === 1 ? '男' : '女'),
          },
          {
            label: '邮箱',
            prop: 'accountEmail',
          },
          {
            label: '电话',
            prop: 'phone',
          },
          {
            label: '公司',
            prop: 'company',
          },
          {
            label: '国家/地区',
            prop: 'area',
          },
          {
            label: '垂直市场',
            prop: 'verticalMarket',
          },
          {
            label: '怎样找到',
            prop: 'howFind',
          },
          {
            label: '申请时间',
            prop: 'createTime',
            minWidth: 170,
          },
          {
            label: '处理结果',
            prop: 'handleResult',
            minWidth: 160,
            formatter: ({ isHandle, handleResult, handleRemark }) => {
              if (isHandle === 1) {
                return handleResult
              }

              return <span>已拒绝(原因：{handleRemark})</span>
            },
          },
          {
            label: '处理时间',
            prop: 'handleTime',
            minWidth: 170,
          },
        ],
        searchForm: [
          {
            $type: 'input',
            $id: 'name',
            label: '邮箱',
            $el: {
              clearable: true,
              placeholder: '请输入',
            },
          },
        ],
      }
    },
  },
  methods: {},
}
</script>

<style lang="less" scoped></style>
